<%@page import="java.util.List"%>
<%@page import="java.util.List"%>
<%@page
	import="com.xz.group12306.business.service.Impl.TicketServiceImpl"%>
<%@page import="com.xz.group12306.business.service.TicketService"%>
<%@page import="com.xz.group12306.domain.Ticket"%>
<%@page import="com.xz.group12306.domain.Ticket"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Insert title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<script type="text/javascript"
	src="../js/util/easyui/jquery.easyui.min.js"></script>

</head>
<base>
<form>
	<table id="t1" class="easyui-datagrid" title="Basic DataGrid"
		style="width: 700px; height: 250px"
		data-options="singleSelect:true,collapsible:true,url:'datagrid_data1.json',method:'get'">

		<thead>
			<tr>
				<th data-options="field:'ticketid',width:80">车票ID</th>
				<th data-options="field:'depature',width:80">始发地</th>
				<th data-options="field:'distinction',width:80">目的地</th>
				<th data-options="field:'trainno',width:80">车次</th>
				<th data-options="field:'starttime',width:150">开车时间</th>
				<th data-options="field:'costtime',width:150">花费时间</th>
				<th data-options="field:'ticketno',width:150">余票</th>
				<th data-options="field:'choose',width:150">选择</th>
			</tr>


		</thead>
		<%
			int pageSize = Integer.parseInt(request.getParameter("pageSize"));
			int start = Integer.parseInt(request.getParameter("start"));

			String depature = request.getParameter("depature");
			String destinction = request.getParameter("destinction");
			Ticket ticket = new Ticket();
			ticket.setDepature(depature);
			ticket.setDestinction(destinction);

			TicketService ticketService = new TicketServiceImpl();
			List<Ticket> tickets = ticketService.findTicketList(ticket, start, pageSize);
		%>

		<%
			for (Ticket ticket2 : tickets) {
		%>
		<tbody>
			<tr>
				<td><%=ticket2.getTicketID()%></td>
				<td><%=ticket2.getDepature()%></td>
				<td><%=ticket2.getDestinction()%></td>
				<td><%=ticket2.getTrainNo()%></td>
				<td><%=ticket2.getStartTime()%></td>
				<td><%=ticket2.getCostTime()%></td>
				<td><%=ticket2.getTicketNo()%></td>
				<td>
						<a href="javascript:void(0)" class="easyui-linkbutton"
							data-options="plain:true"
							onclick="addTab('../OneTicketServlet?TicketID=<%=ticket2.getTicketID()%>')">购买</a>
					
				</td>

			</tr>
		</tbody>
		<%
			}
		%>



	</table>


	<!-- <a href="../user/index.jsp" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">返回</a></div>  -->
</form>
</body>
</html>